import cv2
import matplotlib.pyplot as plt
img = cv2.imread(r"/\images\005.jpeg")
img1 = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
hist = cv2.calcHist([img1], [0, 1], None, [180, 256], [0, 180, 0, 256])
cv2.imshow("test", hist)
cv2.waitKey(0)

plt.imshow(hist, interpolation='nearest')
plt.show()